﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!--自适应界面,如果出现,在某些设备出现界面偏小的话,检查一下有没有加入这句 -->
    <meta http-equiv="Content-type" name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
    <link rel="stylesheet" href="../../../js/jqmobile/jquery.mobile-1.4.5.min.css" />
    <link href="../../../js/layer_mobile/need/layer.css" rel="stylesheet" />
    <!--<script src="../js/jquery.js"></script>-->
    <script src="../../../js/jquery.min2.1.4.js"></script>
    <script src="../../../js/jqmobile/jquery.mobile-1.4.5.min.js"></script>
    <script src="../../../js/cordova-1.5.0.js"></script>
    <script src="../../../js/layer_mobile/layer.js"></script>
    <script src="../../../js/jshelp.js"></script>
    <script>
        //$(document).on("pagecreate", "#pageone", function () {
        //    $(document).on("scrollstart", function () {
        //        alert("开始滚动!");
        //    });
        //});
        //接受传参
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(decodeURI(r[2])); return null; //返回参数值
        }
        var docno = getUrlParam('docno');
        function tz(lx) {
            if (lx == "申请") {
                location.href = "sq_list.html?mobile=" + mobile + "&customerCode=" + customerCode;
            }
            else if (lx == "抢单") {
                location.href = "..\\TransferSnatch\\list.html?mobile=" + mobile + "&customerCode=" + customerCode;
            }
            else if (lx == "发货") {
                location.href = "..\\TransferDeliver\\list.html?mobile=" + mobile + "&customerCode=" + customerCode;
            }
        }
        function add(lx) {
            location.href = "sq_add.html?customerCode=" + customerCode + "&mobile=" + mobile;;
        }
    </script>
    <style>
        ul {
            list-style-type: none;
            padding: 0px;
            margin: 0px;
        }

            ul li {
                background-image: url(sqpurple.gif);
                background-repeat: no-repeat;
                background-position: 0px 5px;
                padding-left: 14px;
            }

        .tck {
            font: normal 12px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
            color: #4f6b72;
            background: #E6EAE9;
            padding: 20px;
        }
        /*按钮*/
        .btn {
            display: block;
            position: relative;
            background: #aaa;
            padding: 10px 20px 10px 20px;
            float: left;
            color: #fff;
            text-decoration: none;
            cursor: pointer;
            font-size: 13px;
            margin: 5px;
        }



        ul,
        li {
            list-style: none;
        }

        a {
            text-decoration: none;
        }

            a:hover {
                cursor: pointer;
                text-decoration: none;
            }

            a:link {
                text-decoration: none;
            }

        img {
            vertical-align: middle;
        }
       
        .ui-listview > p {
            white-space: normal;
        }
        /*店铺名称单号行*/
        div#findsj.ui-grid-a .ui-block-a {
            width: 70%
        }

        div#findsj.ui-grid-a .ui-block-b {
            width: 30%
        }
        /*联系人联系方式行*/
        div#findlxr.ui-grid-a .ui-block-a {
            width: 50%
        }

        div#findlxr.ui-grid-a .ui-block-b {
            width: 50%
        }
        /*发布数量调拨数量日期行*/
        div#findsl.ui-grid-a .ui-block-a {
            width: 30%
        }

        div#findsl.ui-grid-a .ui-block-b {
            width: 30%
        }

        div#findsl.ui-grid-a .ui-block-c {
            width: 40%
        }

        #controlgroupid .ui-controlgroup-controls {
            width: 100%;
        }

        #controlgroupid a {
            width: 25%;
            box-sizing: border-box;
        }

    </style>
</head>
<body>
    <div data-role="page" id="pageone">
        <div data-role="header" data-position="fixed">
            <h1>进度列表</h1>
            <a href="#" class="ui-btn-left" data-rel="back">返回</a>

        </div>
        <div data-role="content" id="main3Content">
            <ul id="thelist" data-role="listview" data-split-icon="gear" data-split-theme="d"
                data-filter="true" data-inset="true" data-filter-placeholder="全局搜索"></ul>
        </div>

    </div>
    <script>
        //加载商品列表
        $(function () {      
            $.ajax({
                type: "get",
                async: false,            //异步请求（同步请求将会锁住浏览器，用户其他操作必须等待请求完成才可以执行）
                url: "ashx/list.ashx?type=get_speed_list&docnos=" + docno + "&a=" + Math.random(),
                data: {},
                dataType: "json",        //返回数据形式为json
                success: function (data) {
                    var str = "";
                    if (data.item.length > 0) {
                        for (var i = 0; i < data.item.length; i++) {
                            str += '<li>';
                            str += '<a href="#" onclick="speed_mx(\'' + data.item[i].docno + '\')">';
                            str += '<h3>' + data.item[i].docno + '</h3>';
                            str += '<h3>抢单人：' + data.item[i].username + '</h3>';
                            str += '<h3>状态：' + data.item[i].zt + '</h3>';
                            str += '<p style="white-space:normal;">' + data.item[i].bjmsg + '</p>';
                            str += '<div id="findsj" class="ui-grid-a">';
                            str += '<div class="ui-block-a">';
                            str += '<p> 时间：' + data.item[i].createtime + '</p>';
                            str += '</div>';
                            str += '<div class="ui-block-b">';
                            str += '<p>数量：' + data.item[i].sl + '</p>';
                            str += '</div>';
                            str += '</div>';
                            str += '</li>';
                            str += '</a>';
                        }
                    }
                    else{
                        str += '<li>';
                        str += '<h3 style="text-align:center;color:red;" >无数据</h3>';
                        str += '</li>';
                    }
                    $("#thelist").html(str);
                    //解决列表样式丢失！
                    $("#thelist").trigger('create');
                    $("#thelist").listview("refresh");
                }
                });      
        })
        function fabu(ids) {
            location.href = "sq_edit.html?id=" + ids +"&mobile=" + mobile + "&customerCode=" + customerCode;
        }
        function speed_mx(docnos) {
            location.href = "speed_mx_list.html?docno=" + docnos;
        }
        //修改
        function update(id) {
            //跳转修改
            location.href = "product_update.html?ids=" + id;
        }
        //作废
        function zf(id) {
            //询问框
            layer.open({
                content: '确定要作废此商品吗？'
                , btn: ['确定', '不要']
                , yes: function (index) {
                    $.ajax({
                        type: "post",
                        async: true,            //异步请求（同步请求将会锁住浏览器，用户其他操作必须等待请求完成才可以执行）
                        url: "ashx/list.ashx?type=zf",
                        data: { ids: id },
                        dataType: "json",        //返回数据形式为json
                        success: function (data) {
                            if (data.message == "商品不存在") {
                                //提示
                                layer.open({
                                    content: "商品不存在!"
                                    , skin: 'msg'
                                    , time: 2 //2秒后自动关闭
                                });
                            } else {
                                layer.open({
                                    content: data.message,
                                    btn: '我知道了',
                                    shadeClose: false,
                                    yes: function () {
                                        location.reload();
                                        layer.close(index);
                                    }
                                });
                            }
                        }
                    });
                }
            });
        }
    </script>

</body>
</html>
